<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>订单列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css" href="../../css/reset.css">
    <link rel="stylesheet" type="text/css" href="../../css/main.css">
    <link rel="stylesheet" type="text/css" href="../../css/member.css">
</head>
<body>
    <header id="header"></header>
    <div class="order-list-wp" id="order-list"></div>
    <script type="text/html" id="order-list-tmpl">
        <div class="order-list">
            <%if (order_group_list.length >0){%>
                <ul>
                    <%for(var i = 0;i<order_group_list.length;i++){
                        var orderlist = order_group_list[i].order_list;
                    %>
                        <li class="<%if(order_group_list[i].pay_amount){%>green-order-skin<%}else{%>gray-order-skin<%}%> <%if(i>0){%>mt10<%}%>">
                            <div class="order-ltlt">
                                <p>
                                    下单时间：
                                   <%=$getLocalTime(order_group_list[i].add_time)%>
                                </p>
                            </div>
                            <% for(var j = 0;j<orderlist.length;j++){
                                var order_goods = orderlist[j].extend_order_goods;
                            %>
                                <div class="order-lcnt">
                                    <div class="order-lcnt-shop">
                                        <p>店铺名称：<%=orderlist[j].store_name%></p>
                                        <p>订单编号：<%=orderlist[j].order_sn%></p>
                                    </div>
                                    <div class="order-shop-pd">
                                        <%for (var k = 0;k<order_goods.length;k++){%>
                                        <a class="order-ldetail clearfix <%if(k>0){%>bd-t-de<%}%>" href="<%=WapSiteUrl%>/tmpl/product_detail.html?goods_id=<%=order_goods[k].goods_id%>">
                                            <span class="order-pdpic">
                                                <img src="<%=order_goods[k].goods_image_url%>"/>
                                            </span>
                                            <div class="order-pdinfor">
                                                <p><%=order_goods[k].goods_name%></p>
                                                <p>
                                                    单价：<span class="clr-d94">￥<%=order_goods[k].goods_price%></span>
                                                </p>
                                                 <p>
                                                    商品数目：<%=order_goods[k].goods_num%>
                                                </p>
                                            </div>
                                        </a>
                                        <%}%>
                                    </div>
                                    <div class="order-shop-total">
                                        <p>运费：<span class="clr-d94">￥<%=orderlist[j].shipping_fee%></span></p>
                                        <p class="clr-c07">合计：￥<%=orderlist[j].order_amount%> </p>
                                        <p class="mt5">
                                            <%
                                                var stateClass ="ot-finish";
                                                var orderstate = orderlist[j].order_state;
                                                if(orderstate == 20 || orderstate == 30 || orderstate == 40){
                                                    stateClass = stateClass;
                                                }else if(orderstate == 0) {
                                                    stateClass = "ot-cancel";
                                                }else {
                                                    stateClass = "ot-nofinish";
                                                }
                                            %>
                                            <span class="<%=stateClass%>"><%=orderlist[j].state_desc%></span>
                                        </p>
                                        <p class="mt5">
                                            <%if(orderlist[j].if_receive){%>
                                            <a href="javascript:void(0)" order_id="<%=orderlist[j].order_id%>" class="sure-order">确认订单</a>
                                            <%}%>
                                             <%if(orderlist[j].if_cancel){%>
                                            <a href="javascript:void(0)" order_id="<%=orderlist[j].order_id%>" class="cancel-order">取消订单</a>
                                            <%}%>
                                            <%if(orderlist[j].if_deliver){%>
                                            <a href="javascript:void(0)" order_id="<%=orderlist[j].order_id%>" class="viewdelivery-order">查看物流</a>
                                            <%}%>
                                        </p>
                                    </div>
                                </div>
                            <%}%>
                            <%if(order_group_list[i].pay_amount && order_group_list[i].pay_amount>0){%>
                                <a href="<%=ApiUrl %>/index.php?act=member_payment&op=pay&key=<%=key %>&pay_sn=<%=order_group_list[i].pay_sn %>" class="l-btn-login check-payment">订单支付（￥<%= p2f(order_group_list[i].pay_amount) %>）</a>
                            <%}%>
                        </li>
                    <%}%>
                </ul>
                <div class="pagination mt10">
                    <a href="javascript:void(0);" class="pre-page <%if(curpage <=1 ){%>disabled<%}%>">上一页</a>
                    <a href="javascript:void(0);" has_more="<%if (hasmore){%>true<%}else{%>false<%}%>"  class="next-page <%if (!hasmore){%>disabled<%}%>">下一页</a>
                </div>
            <%}else {%>
                <div class="no-record">
                    暂无记录
                </div>
            <%}%>
        </div>
    </script>
    <div id="footer"></div>
    <script type="text/javascript" src="../../js/zepto.min.js"></script>
    <script type="text/javascript" src="../../js/template.js"></script>
    <script type="text/javascript" src="../../js/config.js"></script>
    <script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../../js/simple-plugin.js"></script>
    <script type="text/javascript" src="../../js/tmpl/common-top.js"></script>
    <script type="text/javascript" src="../../js/tmpl/footer.js"></script>
    <script type="text/javascript" src="../../js/tmpl/order_list.js"></script>
</body>
</html>